#ifndef IDM_WINDOW_H
#define IDM_WINDOW_H

#include <QMainWindow>
#include <QSystemTrayIcon>
#ifdef HAVE_TEXT_TO_SPEECH
#include <QTextToSpeech>
#endif

// 前向声明
class UIManager;

class IDMWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit IDMWindow(QWidget *parent);
    ~IDMWindow();
    
    // 公开槽函数，供UI管理器调用
    void newDownload();
    void batchDownload();
    void pauseDownload();
    void resumeDownload();
    void cancelDownload();
    void deleteDownload();
    void properties();
    void options();
    void exitApplication();
    void helpContents();
    void about();
    void addUrl();
    void pauseSelected();
    void resumeSelected();
    void deleteSelected();
    void scheduleDownload();
    void openFile();
    void openFolder();
    void showProperties();
    void organizeDownloads();
    void deleteCompleted();
    void connectToProxy();
    void disconnectFromProxy();
    void refreshList();
    void showDownloadsPanel(bool show);
    void readAloud();
    void toggleTheme();
    void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
    void showContextMenu(const QPoint &pos);
    void filterDownloads(int index);
    void toggleCategoryPanel();
    void resizeEvent(QResizeEvent *event) override;

private:
    UIManager *m_uiManager;
    
#ifdef HAVE_TEXT_TO_SPEECH
    // 音频朗读功能
    QTextToSpeech *textToSpeech;
#endif
};

#endif // IDM_WINDOW_H